<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  const p = new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve('data');
    }, 1000)
  });

  const result = p.then(value => {
    console.log(value);
    return 'aaa';
  }, reason => {
    console.warn(reason);
  });

  console.log(result);
</script>
</body>
</html>